<?php
	//引入模块公共方法文件
	require_once(dirname(__FILE__)."/../../global.php");
	require_once ("foundation/UploadFile.class.php");
// 	require("foundation/aintegral.php");
// 	require("configuration.php");
// 	require("includes.php");
// 	require("api/base_support.php");

	
//     //检测上传相片是否都为空
//     $is_true=0;
//     for($i=0;$i<count($_FILES['attach']['name']);$i++){
//     	if(!empty($_FILES['attach']['name'][$i]))
//     		$is_true++;
//     }
// 	if($is_true==0){
// 		echo "{'error':'without upload file'}";
// 	}

// 	$base_root="uploadfiles/album/";//图片存放目录
//     $up = new upload();
//     $up->set_dir($base_root,'{y}/{m}/{d}');//目录设置
//     $up->set_thumb(180,180); //缩略图设置
//     $fs = $up->execute();

//     foreach($fs as $index=>$realtxt){
//     	if($realtxt['flag']==1){
//     		$fileSrcStr=str_replace(dirname(__FILE__),"",$realtxt['dir']).$realtxt['name'];
//     		$thumb_src=str_replace(dirname(__FILE__),"",$realtxt['dir']).$realtxt['thumb'];
//     	}
//     }
    
    
$allowedExtensions = array("jpg","jpeg", "xml", "bmp","png");
// max file size in bytes
$sizeLimit = 10 * 1024 * 1024;

//require('valums-file-uploader/server/php.php');
$uploader = new qqFileUploader($allowedExtensions, $sizeLimit);

// Call handleUpload() with the name of the folder, relative to PHP's getcwd()
$uploader->set_dir('uploads/');
$result = $uploader->handleUpload();
    
       
?>
